#pragma once

/**
 * Toolbar implementation.
 */
class CNravitsyaMailRuToolbar : public CWindowImpl<CNravitsyaMailRuToolbar, CToolBarCtrl>
{
public:
	CNravitsyaMailRuToolbar(void);
	~CNravitsyaMailRuToolbar(void);

	DECLARE_WND_SUPERCLASS(TEXT("NRAVITSYAMAILRUTOOLBAR"), CToolBarCtrl::GetWndClassName())

	BEGIN_MSG_MAP_EX(CNravitsyaMailRuToolbar)
		COMMAND_ID_HANDLER_EX0(IDM_NRAVITSYAMAILRU, OnButtonPresed)
	END_MSG_MAP()

	bool Create(const CWindow &wndParent);

	void SetBrowser(IWebBrowser2* pBrowser);

	int GetMaxWidth();

protected: // Handlers
	LRESULT OnToolTip(LPNMHDR pnmh);

	void OnButtonPresed();

private:
	WEBBrowser			m_browser;

private:
	static CriticalSection	m_crsecInit;
	static bool				m_bInitialized;
	static TBBUTTON			m_buttons[1];
	static CManagedImageList m_image_list;
	static CString			m_strButtonNravitsya;

	static void Init();

private:
	static CLogger logger;
};
